﻿<Window x:Class="UniversalEditor.Modules.OpenedTabModule.OpenedTabView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:openedTabModule="clr-namespace:UniversalEditor.Modules.OpenedTabModule"
        mc:Ignorable="d" d:DataContext="{x:Static openedTabModule:OpenedTabViewModel.Designer}"
        Title="Windows" Height="312" Width="575" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition Width="Auto"/>
		</Grid.ColumnDefinitions>

		<ListView x:Name="listView" Margin="10" Grid.RowSpan="4" ItemsSource="{Binding OpenedDocuments}" SelectionMode="Single" SelectedItem="{Binding ActiveEditor, Mode=OneTime}">
			<ListView.View>
				<GridView>
					<GridViewColumn Header="Name" DisplayMemberBinding="{Binding FileName}"/>
					<GridViewColumn Header="Path" DisplayMemberBinding="{Binding FilePath}"/>
				</GridView>
			</ListView.View>
		</ListView>

		<Button Content="Activate" Grid.Column="1" Margin="0,10,10,0" Padding="10,0,10,0"
				Command="{Binding ActivateCommand}" CommandParameter="{Binding ElementName=listView, Path=SelectedItem}"/>
		<Button Content="Save" Grid.Row="1" Grid.Column="1" Margin="0,10,10,0" Padding="10,0,10,0" IsEnabled="{Binding ElementName=listView, Path=SelectedItem.HasChanges}"
				Command="{Binding SaveCommand}" CommandParameter="{Binding ElementName=listView, Path=SelectedItem}"/>
		<Button Content="Close Window" Grid.Row="2" Grid.Column="1" Margin="0,10,10,0" Padding="10,0,10,0"
				Command="{Binding CloseCommand}" CommandParameter="{Binding ElementName=listView, Path=SelectedItem}"/>
		<Button Content="OK" Grid.Row="4" Grid.Column="1" Margin="10" Padding="10,0,10,0" IsCancel="True"/>

	</Grid>
</Window>
